Hey harisson, any idea to do an pyqt5 tut? It seems that the module is changed quit a bit in compares pyqt4. The import statements are quit different to begin with. I try to update the code for all the lessons i'm watching your tuts now and try to port it to pyqt5
for example intro lesson PyQt5 would be
import sys from PyQt5.QtWidgets import QApplication, QWidget
You must be logged in to post. Please login or register an account.
if you are ok with it, by time i try to port your examples to pyqt5 standards ?
-kenwaldek 8 years ago
Last edited 8 years ago
You must be logged in to post. Please login or register an account.
I plan to eventually do a pyqt5 tutorial, but no idea when. You're free to make the updates. If you want to share with others, post them to the tutorial videos, I'll happily pin them to the top if I see them.
-Harrison 8 years ago
You must be logged in to post. Please login or register an account.
Today i did from 1 - 9 had some problems but everything works, the problem is i can't post it in youtube 'code is to long' to paste and save. It chopped of the .tail of the code If you want i post it here, the first lesson i posted the rest i didn't. I will post it on a branch on github when all lessons are done so you can reach them if you want.
-kenwaldek 8 years ago
Last edited 8 years ago
You must be logged in to post. Please login or register an account.
I have a problem with lesson 14 opening an file with mac OS X could someone try to open a file with the code below. you see the error message in comments and the code is marked with ##todo ##end
extractAction = QAction('&Get to the choppah', self) extractAction.setShortcut('Ctrl+Q') extractAction.setStatusTip('leave the app') extractAction.triggered.connect(self.close_application)
##Todo looking what the error is can't open an file program ends in osx ## file = open(name, 'r') ## TypeError: expected str, bytes or os.PathLike object, not tuple def file_open(self): name = QFileDialog.getOpenFileName(self, 'Open File') file = open(name, 'r')
self.editor()
with file: text = file.read() self.textEdit.setText(text)
##End of code problem def color_picker(self): color = QColorDialog.getColor() self.styleChoice.setStyleSheet('QWidget{background-color: %s}' % color.name())
def font_choice(self): font, valid = QFontDialog.getFont() if valid: self.styleChoice.setFont(font)
checkBox = QCheckBox('Enlarge window', self) # checkBox.toggle() # if you want to be checked in in the begin checkBox.move(0, 50) checkBox.stateChanged.connect(self.enlarge_window)
You must be logged in to post. Please login or register an account.
Have found the error finally
def file_open(self): # need to make name an tupple otherwise i had an error and app crashed name, _ = QFileDialog.getOpenFileName(self, 'Open File', options=QFileDialog.DontUseNativeDialog) print('tot na dialog gelukt') file = open(name, 'r') print('na het inlezen gelukt') self.editor()
with file: text = file.read() self.textEdit.setText(text)
-kenwaldek 8 years ago
You must be logged in to post. Please login or register an account.